
package com.xpo.settingskeeper;

import android.app.Service;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.IBinder;
import android.util.Log;

public class BackupService extends Service {
    private static final String TAG = "BackupService";

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onStart(Intent intent, int startId) {
        super.onStart(intent, startId);

        Log.i(TAG, "onStart()");
        if (NameSpace.BACKUP_SERVICE.equals(intent.getAction())) {
            BackupTask task = new BackupTask();
            task.execute((Void[])null);
        }
    }

    class BackupTask extends AsyncTask<Void, Void, Void> {

        @Override
        protected Void doInBackground(Void... arg) {

            return null;
        }

        @Override
        protected void onPostExecute(Void result) {
            super.onPostExecute(result);

            stopSelf();
        }
    }
}
